package com.dwxt.cdms.entity.yumeng;

import com.dwxt.cdms.util.DictUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.LocalDateTime;

/**
 * 翎盟-外接设备数据
 *
 * @author Kuang.JiaZhuo
 * @date 2020-09-09 16:27
 */
@Data
@Accessors(chain = true)
@Table(name = "t_exdevice_data")
public class ExdeviceData {
    @Id
    private String id;

    /**
     * 接收的内容原始数据储存id
     */
    @Column(name = "receive_data_id")
    private String receiveDataId;

    /**
     * 设备标识
     */
    @Column(name = "device_identity")
    private String deviceIdentity;

    /**
     * 设备类型;关联数据字典【deviceType】
     */
    @Column(name = "device_type")
    private String deviceType;

    public String getDeviceTypeDisplay(){
        return deviceType!=null? DictUtil.getDisplay("deviceType",deviceType):null;
    }

    /**
     * 客户id
     */
    @Column(name = "customer_id")
    private Integer customerId;


    /**
     * 采集时间
     */
    private String time;

    /**
     * 血压收缩压(血压仪)
     */
    @Column(name = "BPS")
    private Integer bps;

    /**
     * 血压舒展压(血压仪)
     */
    @Column(name = "BPD")
    private Integer bpd;

    /**
     * 脉率(血压仪;血氧仪)
     */
    @Column(name = "PR")
    private Integer pr;

    /**
     * 总胆固醇;单位:mg/dl(血糖仪)
     */
    @Column(name = "CHOL")
    private Double chol;

    /**
     * 血红素; 单位:g/dl(血糖仪)
     */
    @Column(name = "HB")
    private Double hb;

    /**
     * 血糖; 单位:mg/dl(血糖仪)
     */
    @Column(name = "GLU")
    private Double glu;

    /**
     * 尿酸;单位:mg/dl(血糖仪)
     */
    @Column(name = "UA")
    private Double ua;

    /**
     * 血氧百分比(血氧仪)
     */
    @Column(name = "BO")
    private Integer bo;

    /**
     * 用户标识
     */
    @Column(name = "user_id")
    private String userId;

    /**
     * 创建时间(录入数据库的时间)
     */
    @Column(name = "create_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime createTime;

    /**
     * 逻辑删除标识(0否1是)
     */
    @Column(name = "is_delete")
    private String isDelete;

    /**
     * 备用字段1
     */
    @Column(name = "spare_field_1")
    private String spareField1;


}